import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index'
import limit from '@/components/limit'
import limitDetail from '@/components/limit-detail'
import fresh from '@/components/fresh'
import freshDetail from '@/components/fresh-detail'
import detailComment from '@/components/detail-comment'
import specialty from '@/components/specialty'
import specialtyDetail from '@/components/specialty-detail'
import distribution from '@/components/distribution'
import news from '@/components/news'
import newsDetail from '@/components/news-detail'
import about from '@/components/about'
import login from '@/components/login'
import reg from '@/components/reg'
import forget from '@/components/forget'
import person from '@/components/person'
import basicinfo from '@/components/basicinfo'
import shopcar from '@/components/shopcar'
import myorder from '@/components/myorder'
import comment from '@/components/comment'
import look from '@/components/look'
import modify from '@/components/modify'
import shaddress from '@/components/shaddress'
import mydistribution from '@/components/mydistribution'
import txpage from '@/components/txpage'
import addaddress from '@/components/addaddress'
import mycode from '@/components/mycode'
import buystep from '@/components/buystep'
import buypage from '@/components/buypage'
import searchpage from '@/components/searchpage'


Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path: '/limit',
      name: 'limit',
      component: limit
    },
    {
      path: '/limit/limit-detail',
      name: 'limitDetail',
      component: limitDetail
    },
    {
      path: '/fresh',
      name: 'fresh',
      component: fresh
    },
    {
      path: '/fresh/fresh-detail',
      name: 'freshDetail',
      component: freshDetail
    },
    {
      path: '/fresh/detail-comment',
      name: 'detailComment',
      component: detailComment
    },
    {
      path: '/specialty',
      name: 'specialty',
      component: specialty
    },
    {
      path: '/specialty/specialty-detail',
      name: 'specialtyDetail',
      component: specialtyDetail
    },
    {
      path: '/distribution',
      name: 'distribution',
      component: distribution
    },
    {
      path: '/news',
      name: 'news',
      component: news,

    },
    {
      path: '/news/news-detail',
      name: 'newsDetail',
      component: newsDetail
    },
    {
      path: '/about',
      name: 'about',
      component: about
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/reg',
      name: 'reg',
      component: reg
    },
    {
      path: '/forget',
      name: 'forget',
      component: forget
    },
    {
      path: '/person',
      name: 'person',
      component: person
    },
    {
      path: '/basicinfo',
      name: 'basicinfo',
      component: basicinfo
    },
    {
      path: '/shopcar',
      name: 'shopcar',
      component: shopcar
    },
    {
      path: '/myorder',
      name: 'myorder',
      component: myorder
    },
    {
      path: '/comment',
      name: 'comment',
      component: comment
    },
    {
      path: '/look',
      name: 'look',
      component: look
    },
    {
      path: '/modify',
      name: 'modify',
      component: modify
    },
    {
      path: '/shaddress',
      name: 'shaddress',
      component: shaddress
    },
    {
      path: '/addaddress',
      name: 'addaddress',
      component: addaddress
    },
    {
      path: '/mydistribution',
      name: 'mydistribution',
      component: mydistribution
    },
    {
      path: '/txpage',
      name: 'txpage',
      component: txpage
    },
    {
      path: '/mycode',
      name: 'mycode',
      component: mycode
    },
    {
      path: '/buystep',
      name: 'buystep',
      component: buystep
    },
    {
      path: '/buypage',
      name: 'buypage',
      component: buypage
    },
    {
      path: '/searchpage',
      name: 'searchpage',
      component: searchpage
    }
  ],
  scrollBehavior(to, from,savedPosition) {  
      return {  
        x: 0,  
        y: 0  
      }  
  }
})
